#coding=utf-8
class Student(object):
    def __init__(self, name, age=None):
        self.name = name
        self.age = age

class Studentlimit(object):
    def __init__(self, name):
        self.name = name

    def set_age(self, age):
        if not isinstance(age, int):
            raise ValueError('输入不合法：年龄必须为数值!')
        if not 0 < age < 100:
            raise ValueError('输入不合法：年龄范围必须0-100')
        self._age=age

    def get_age(self):
        return self._age

    def del_age(self):
        self._age = None

# 实例化
xm = Student("小明")
xh = Studentlimit("小华")

# 添加属性
xm.age = 25
#xm.age = -5
xh.set_age(26)
#xh.set_age(-5)
# 查询属性
print(xm.age)
print(xh.get_age())
# 删除属性
del xm.age
xh.del_age()